package ledger

import (
	"gitee.com/kessil/naive/serve/app/models/ledger"
	"gitee.com/kessil/naive/serve/pkg/util"
	"github.com/gofiber/fiber"
)

type StaticController struct{}

func (i StaticController) Static(c *fiber.Ctx) error {
	var static ledger.Static
	err := util.ReadJson("./config/station.yaml")
	if err != nil {
		return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
			"code":    0,
			"message": "读取配置失败 " + err.Error(),
		})
	}
	return c.Status(fiber.StatusOK).JSON(fiber.Map{
		"code":    0,
		"message": "获取静态数据成功",
		"data":    static,
	})
}
